@import "./variables";

.#{$component-prefix}radio {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  font-size: $radio-font-size;
  cursor: pointer;
  user-select: none;

  &--disabled {
    cursor: not-allowed;
  }

  &--horizontal {
    margin-right: $radio-gap;

    &:last-child {
      margin-right: 0;
    }
  }

  &--vertical {
    margin-bottom: $radio-gap;

    &:last-child {
      margin-bottom: 0;
    }
  }

  &__icon {
    flex: none;
    height: 1em;
    font-size: $radio-icon-font-size;
    line-height: 1em;
    cursor: pointer;

    .#{$component-prefix}icon {
      box-sizing: border-box;
      display: block;
      width: 1.25em;
      height: 1.25em;
      font-size: 0.8em;
      line-height: 1.25;
      color: transparent;
      text-align: center;
      border: 1px solid $radio-border-color;
      transition-duration: $radio-transition-duration;
      transition-property: color, border-color, background-color;
    }

    &--round {
      .#{$component-prefix}icon {
        border-radius: 100%;
      }
    }

    &--checked {
      .#{$component-prefix}icon {
        color: $radio-checked-icon-color;
        background: $radio-checked-icon-background-color;
        border-color: $radio-checked-icon-border-color;
      }

      &.#{$component-prefix}radio__icon--disabled {
        .#{$component-prefix}icon {
          color: $radio-disabled-icon-color;
        }
      }
    }

    &--disabled {
      cursor: not-allowed;

      .#{$component-prefix}icon {
        background: $radio-disabled-icon-background-color;
        border-color: $radio-disabled-icon-border-color;
      }
    }
  }

  &__label {
    margin-left: $radio-label-margin;
    line-height: $radio-label-line-height;
    color: $radio-label-color;

    &--left {
      margin: 0 $radio-label-margin 0 0;
    }

    &--disabled {
      color: $radio-disabled-label-color;
    }
  }
}
